<extend name="common/base" />
<block name="resource">
    <link href="__PUBLIC__/Home/ui3/css/share.css" rel="stylesheet">
    <link href="__PUBLIC__/Home/v4/src/css/video.css" rel="stylesheet">
    <script type="text/javascript" src="__PUBLIC__/Home/ui3/js/lib/knockout-2.3.0.js"></script>
    <script type="text/javascript" src="__PUBLIC__/Home/ui3/js/common.js?v=1.0.2"></script>
    <script src="__ASSET__/Home/v4/lib/js/jwplayer.js"></script>
    <!-- 表情核心JS -->
    <script src="__PUBLIC__/Home/ui3/js/face.js" type="text/javascript"></script>
    <!-- 分页JS -->
    <script src="__PUBLIC__/Home/ui3/js/web/paging.js" type="text/javascript"></script>
    <!-- 替换表情文字 -->
    <script src="__ASSET__/Home/ui3/js/web/emotion.js?v=1.0" type="text/javascript"></script>
    <script src="__PUBLIC__/Home/ui3/js/web/share/comment.js?v=1.0.1" type="text/javascript"></script>
    <script type="text/javascript" src="__PUBLIC__/Home/ui3/js/zclip/jquery.zclip.min.js"></script>
    <script type="text/javascript" src="__PUBLIC__/Home/ui3/js/web/home/recommend.js?v=1.0.2" type="text/javascript"></script>
    <script type="text/javascript" src="__PUBLIC__/Home/v4/src/js/video_v4.js"></script> 
    <style>
     .author-nick a{
           color: #349ff9;
     }
     .game-info span a{
          color:#349ff9;
          margin-top:0;
     }
     .banner-cover{
         width:100%;
         height:90px;
     }
     .comment-content{
         word-break:break-all;
     }
    </style>
</block>
<block name="content">
       <div class="container" style="margin-top:80px;">
               <div class="share-left  left" data-bind="with:video">
                    <include file="Template/banner_video" />
                    <div class="video-box">
                        <div class="video-info">{$video.title}</div>
                        <div class="mod_player  relative">
                                <div id="mod_player"></div>
                                 <!--视频播放完成弹窗S-->
                                <div id="myPopup">
                                    <div class="row">
                                        <div class="col-xs-8 related-videos">
                                            <h1>相关视频</h1>
                                            <ul  data-bind="foreach:viewModel.recommendList()">
                                                <!-- ko if: $index() < 4 -->
                                                    <li>
                                                        <a href="" data-bind="attr:{'href':link}">
                                                            <div class="related-video-img relative">
                                                                <img src="" data-bind="attr:{'src':thumb}"/>
                                                                <span class="related-video-name" data-bind="text:title"></span>
                                                            </div>
                                                        </a>
                                                    </li>
                                                <!-- /ko -->
                                           </ul> 
                                        </div>
                                      <div class="col-xs-4 row-right relative">
                                          <h1>下载66Play APP 精彩不错过</h1>
                                          <p><img src="__PUBLIC__/Home/ui3/images/66play-ma.jpg"/></p> 
                                          <span class="replay" onclick="Videoreplay()"><img src="__PUBLIC__/Home/ui3/images/replay.png"/>重播</span>
                                      </div>
                                    </div>
                                </div>
                                <div class="popbg" onclick="hid()"></div>
                                <!--视频播放完成弹窗E-->
                        </div>
                        <div class="video-share">
                               <div class="share-logo"></div>
                               <div class="video-share-span">分享到：</div>
                               <div id="share">
                                   <div class="bdsharebuttonbox">
                                       <a class="bds_qzone" data-cmd="qzone" title="分享到QQ空间"></a>
                                       <a class="bds_tsina"data-cmd="tsina"title="分享到新浪微博"></a>
                                       <a class="bds_sqq" data-cmd="sqq" title="分享到QQ好友"></a>
                                       <a class="bds_weixin"data-cmd="weixin"title="分享到微信"></a>
                                       <a class="bds_other"  data-bind="click:famulei_share"  title="分享到伐木累"></a>
                                   </div>
                               </div>
                               <div class="iframesrc">
                                   <span class="colorsix left" style="margin-right:5px;">嵌入代码</span>
                                   <input id="iframecode" type="text" value=""  data-bind="value:copy"  readonly="true"/>
                                   <button class="copy-btn">复制</button>
                               </div>
                                <div class="" data-bind="click:doLike,css:{'video-zaned':zan.is_zan(), 'video-zan':!zan.is_zan()}">
                                   <span class="zan-img"></span>
                                   <span class="zan-num">赞:<!-- ko text:zan.count --><!-- /ko --></span>
                               </div>
                               <div class="video-hot">播放次数:<!-- ko text:playCount --><!-- /ko --></div>
                        </div>
                        <div class="author-box">
                                   <div class="avatar relative">
                                       <a href="/user-{$video.user.id}">
                                           <img src="" alt="{$video.user.nickname}" data-bind="attr:{'src':user.avatar}"/>
                                           <!-- ko if:user.auth -->
                                              <img src="" title="" class="newG-icon" data-bind="attr:{'src':user.auth.pic, 'title':user.auth.name}">
                                           <!-- /ko -->
                                       </a>
                                   </div>
                                   <div class="author-infos">
                                       <div class="author-info" style="overflow:hidden;">
                                           <div class="author-nick">
                                               <a href="/user-{$video.user.id}">{$video.user.nickname}</a>
                                           </div>
                                           <div class="level">Lv.{$video.user.level}</div>
                                       </div>
                                       <div class="author-tips">
                                           <span>视频:</span>
                                           <span>{$video.user.tradeCount}</span>
                                           <span>粉丝:</span>
                                           <span><!-- ko text:user.fans --><!-- /ko --></span>
                                       </div>
                                       <div class="followBtn" data-bind="visible:viewModel.self().id != user.id">
                                           <button class="my-info-status" data-bind="text:user.is_follow()?'已关注':'关注', click:doFollow, css:{statusTwo:!user.is_follow(), statusOne:user.is_follow()}"></button>
                                       </div>
                                   </div>
                                   <div class="game-box">
                                       <div class="game-info">
                                           <span>所属游戏：</span>
                                           <span class="game-kind"><a href="/game-{$video.game.id}">{$video.game.name}</a></span>
                                           <span>上传于：</span>
                                           <span>{$video.create_time|date="Y-m-d",###}</span>
                                       </div>
                                       <div class="game-infos">视频简介：{$video.detail|default=$video['title']}</div>
                                   </div>
                        </div>
                   </div>
                   <div  id="myComment">
                            <div  style="height:120px;">
                                <div class="comment-avatar">
                                    <a href="javascript:void(0);">
                                        <img src="" alt="" data-bind="attr:{'src':viewModel.self().avatar, 'alt':viewModel.self().nickname}"/>
                                    </a>
                                </div>
                                <div class="reply-box JS-comment_box">
                                    <textarea id="JS_comment_a" class="JS_comment_a_1" placeholder="发表你的评论吧！"></textarea>
                                    <button class="rp btn myBtn btn_v4" data-bind="click:postComment">发表<br/>评论</button>
                                    <div class="">
                                        <i class="emotion"></i>
                                        <!-- <input  type="button" value="取消" class="rc btn btn-default"/> -->
                                    </div>
                                </div>
                            </div>
                   </div>
                   <div class="comment-box">
                                    <div class="comment-title">
                                        <span>全部评论</span>
                                        <span>(<!-- ko text:viewModel.commentCount() --><!-- /ko -->条)</span>
                                        <span class="write-comment"><a href="#myComment">写评论</a></span>
                                    </div>
                                    <div class="comment-box">
                                        <div class="load-more" data-bind="visible:viewModel.commentLoading()">
                                            <i><img src="__PUBLIC__/Home/ui3/images/loading-white.gif" alt="正在加载，请稍候..."/></i>
                                            <span>正在加载，请稍候...</span>
                                        </div>
                                        <div class="comment-list" data-bind="foreach:viewModel.commentList()">
                                            <div class="comment-item JS-comment_item">
                                                <div class="comment-avatar relative">
                                                    <a href="javascript:void(0);" data-bind="attr:{'href':isValidUser ? userLink : 'javascript:void(0);'}">
                                                        <img src="" alt="" data-bind="attr:{'src':avatar, 'alt':nickname}"/>
                                                        <!-- ko if:auth -->
                                                        <img src="" title="" class="newG-icon" data-bind="attr:{'src':auth.pic, 'title':auth.name}">
                                                        <!-- /ko -->
                                                    </a>
                                                </div>
                                                <div class="comment-user">
                                                    <div class="nl">
                                                        <div class="comment-n"><a href="javascript:void(0);" data-bind="attr:{'href':isValidUser ? userLink : 'javascript:void(0);'}, text:nickname"></a></div>
                                                        <div class="comment-l" data-bind="text:level">LV.0</div>
                                                    </div>
                                                    <div class="comment-content" data-bind="html:content"></div>
                                                    <div class="comment-tips">
                                                        <span class="floor" data-bind="text:floor"></span>
                                                        <span class="c-time" data-bind="text:create_time"></span>
                                                        <!-- ko if:isValidUser-->
                                                        <span class="reply" data-bind="click:reply.show">回复TA</span>
                                                        <!-- /ko -->
                                                        <span class="from">来自66play网页</span>
                                                    </div>
                                                    <div class="reply-comment JS-comment_box">
                                                        <div class="comment-avatar">
                                                            <a href="javascript:void(0);">
                                                                <img src="" alt="" data-bind="attr:{'src':viewModel.self().avatar, 'alt':viewModel.self().nickname}"/>
                                                            </a>
                                                        </div>
                                                        <div class="reply-box">
                                                            <textarea id="" data-bind="attr:{'id':'comment_c_'+id}" placeholder="发表你的评论吧！"></textarea>
                                                            <input type="button" value="发表" class="rp btn myBtn btn_v4" data-bind="click:postComment"/>
                                                            <div>
                                                                <i class="emotion"></i>
                                                                <input type="button" value="取消" class="rc btn btn-default btn-default-v4" data-bind="click:reply.hide"/>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                                <div class="clearflaot"></div>
                                            </div>
                                        </div>
                                        <div class="comment-null" data-bind="visible:viewModel.commentCount() < 1">
                                            <div class="null-pic"></div>
                                            <p>还没有人评论过</p>
                                            <p>沙发虚位以待，快来抢吧！</p>
                                        </div>
                                        <div class="page page-v4">
                                            <ul data-bind="visible: viewModel.commentPaging().length > 1, foreach:viewModel.commentPaging">
                                                <li data-bind="css:{'active': is_current, 'next':is_next}, click:click">
                                                    <a href="javascript:void(0);" data-bind="text:text"></a>
                                                </li>
                                            </ul>
                                        </div>
                                        <!-- ko if:viewModel.commentCount() >= 10 -->
                                        <div class="myComment" id="myComment">
                                            <div class="myComment-title">写评论</div>
                                            <div class="myComment-write">
                                                <div class="comment-avatar">
                                                    <a href="javascript:void(0);">
                                                        <img src="" alt="" data-bind="attr:{'src':viewModel.self().avatar, 'alt':viewModel.self().nickname}"/>
                                                    </a>
                                                </div>
                                                <div class="reply-box JS-comment_box">
                                                    <textarea id="JS_comment_a" placeholder="发表你的评论吧！"></textarea>
                                                    <button class="rp btn myBtn btn_v4" data-bind="click:postComment">发表<br/>评论</button>
                                                    <div class="">
                                                        <i class="emotion"></i>
                                                        <!-- <input  type="button" value="取消" class="rc btn btn-default"/> -->
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                        <!-- /ko -->

                                    </div>
                    </div>
               </div>
               <div class="share-right right">
                       <div class="video-info">
                          <span class="title">热门推荐</span>
                          <span class="change" data-bind="click:changeRecommend">换一批</span>
                      </div>
                      <div class="recommend-box" data-bind="foreach:recommendList">
                        <div class="recommend-item-list JS_recommend">
                            <a href="" data-bind="attr:{'href':link}, event:{mouseover:play, mouseout:pause}">
                                <div class="item-video">
                                    <video class="myVideo" style="background: rgba(0, 0, 0, 1) none repeat scroll 0 0;" src="" poster="" data-bind="attr:{'poster':thumb, 'src':src}"></video>
                                    <div class="game">
                                        <!-- <span class="game-kinds"></span> -->
                                        <span class="game-name" data-bind="text:game_name"></span>
                                        <span class="game-time" data-bind="text:time"></span>
                                    </div>
                                </div>
                                <div class="item-details" data-bind="text:title"></div>
                                <div class="item-info">
                                    <div class="item-nickname">
                                        <i class="nick-icon"></i>
                                        <div class="nick" data-bind="text:nickname"></div>
                                    </div>
                                    <div class="item-play">
                                        <i class="play-icon"></i>
                                        <div class="play-num">播放<!-- ko text:playCount --><!-- /ko --></div>
                                    </div>
                                </div>
                            </a>
                        </div>
                    </div>
               </div>
       </div>
</block>
<block name="component">
    <a href="#0" class="cd-top">Top</a>
    <script>
        if (window.parent != window.self) {
            location.href = "{:C('LOCAL_DOMAIN')}/video-play-{$video.id}";
        }
        window._THIS = {
            videoLink : "/video-",
            userLink : "/user-",
            iframeUrl : "{:C('LOCAL_DOMAIN')}/video/play-mobile-{$video.id}.html",
            recommendUrl : "{:U('share/video', ['id' => $video['id']])}",
            likeUrl : {
                dolike : "{:U('like/dolike')}",
                unlike : "{:U('like/unlike')}",
            },
            followUrl : {
                dofollow : "{:U('follow/dofollow')}",
                unfollow : "{:U('follow/unfollow')}",
            },
            commentUrl : {
                get : "{:U('video/getCommentList')}",
                post : "{:U('video/comments')}",
            },
            commentPager : 20,
            video : {$video|json_encode},
            thumb:  "{$video.thumb}",
            userInfo:{$userInfo|json_encode},
            about_videos:{$about_videos|json_encode},
            setPlay:"{:U('api/video/setPlay', ['id' => $video['id'], 'appid' => $appid])}"
        };
        $(function(){
              window._bd_share_config = {
                "common": {
                    "bdSnsKey": {},
                    "bdText": "",
                    "bdMini": "2",
                    "bdMiniList": false,
                    "bdPic": "",
                    "bdStyle": "0",
                    "bdSize": "16",
                    onBeforeClick:function(cmd,config){
                        return {
                            bdUrl:_COMMON.domain + "{:U('share/video', ['id' => $video['id']])}" + "?type=share",
                            bdText:"{$video.title}",
                            bdPic:"{$video.thumb}"
                        };
                    }
                },
                "share": {}
            };
            with (document)0[(getElementsByTagName('head')[0] || body).appendChild(createElement('script')).src = 'http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion=' + ~(-new Date() / 36e5)];

        })
       //伐木累分享
        var famulei_share = function(){
            var video_url = _COMMON.domain + '/api/video/source/id/{$video.id}.mp4?uri=' + encodeURIComponent("{$video.uri}") + '&from=famulei';
            var url = 'http://www.famulei.com/share_publish';
                url += '?title=' + encodeURIComponent("{$video.title}");
                url += '&video_url=' + encodeURIComponent(video_url);
                url += '&video_image=' + encodeURIComponent("{$video.thumb}");
                window.open(url);
        }
    </script>
</block>